﻿{extend name="layout/main-block" /}
{block name="sub-wrapper"}
<!--内容容器-->
<section id="sub-wrapper" class="full-screen page-account">
    <!--数据展示容器-->
    <div id="sub-content">
        <div id="sub-header">
            <div class="sub-title">
                <h3><i class="fa fa-users"></i>账户--账户管理</h3>
            </div>
            <div class="sub-tools">
                <div id="searchTool">
                    <form class="form-inline">
                        <!--<label class="">选择日期:</label>
                        <input size="10" class="form-control" id="startDate" />
                        <label class="">-</label>
                        <input size="10" class="form-control" id="endDate" />-->
                        <input size="30" class="form-control" id="phname" placeholder="请输入账户名进行检索" />
                        <a class="btn btn-primary" id="searchname"><i class="fa fa-search"></i>搜索</a>
                        <a class="btn btn-info" id="delSearch"><i class="fa fa-search"></i>清空搜索</a>
                    </form>
                </div>
            </div>
        </div>
        <div class="table-responsive data-table">
            <table class="table table-striped table-bordered table-hover">
                <thead>
                <tr>
                    <th class="text-center" width="34px">
                        <input id="selectAll" type="checkbox" />
                    </th>
                    <th>ID</th>
                    <th>账户名</th>
                    <th>昵称</th>
                    <th width="160px">最近登录</th>
                    <th>电子邮箱</th>
                    <th>设备数</th>
                    <th>用户组</th>
                    <th>代理商</th>
                    <th>积分</th>
                    <th width="160px">注册时间</th>
                    <th width="160px">备注</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {volist name="account" id="v" empty="$empty" }
                <tr>
                    <td class="text-center">
                        <input type="checkbox" />
                    </td>
                    <td>{$v.id}</td>
                    <td>{$v.username}</td>
                    <td>{$v.nickname}</td>
                    <td>{$v.last_login_at}</td>
                    <td>{$v.email}</td>
                    <td>{$v.device_count}</td>
                    <td>{$v.groupname}</td>
                    <td>{$v.agentname}</td>
                    <td>{$v.integral}</td>
                    <td>{$v.created_at}</td>
                    <td>{$v.remark}</td>
                    <td>
                        <ul class="record-tool">
                            <li><a class="btn btn-info btn-sm viewRecord" data-name="{$v.id}" >查看</a></li>
                            <li><a class="btn btn-warning btn-sm editRecord" data-name="{$v.id}" >修改</a></li>
                            <li><a class="btn btn-danger btn-sm delRecord" data-name="{$v.id}">删除</a></li>
                        </ul>
                    </td>

                </tr>
                {/volist}
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="6">
                        <ul class="record-tool">
                            <!--<li><a class="btn btn-success btn-sm" id="addRecord"><i class="fa fa-plus"></i>
                                增加</a></li>-->
                            <li><a class="btn btn-danger btn-sm" id="batchDel"><i class="fa fa-minus"></i>
                                批量删除</a></li>
                        </ul>
                    </td>

                    <td colspan="3" class="">
                        {$page}
                        <!--<ul class="pagination">
                            <li :class="{'disabled': current == 1}">
                                <a href="javascript:;" @click="setCurrent(current - 1)" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                            <li :class="{'disabled': current == 1}" @click="setCurrent(1)"><a href="javascript:;">首页</a></li>
                            <li v-for="p in grouplist" :class="{'active': current == p.val}"><a href="javascript:;" @click="setCurrent(p.val)">111</a></li>
                            <li :class="{'disabled': current == page}"><a href="javascript:;" @click="setCurrent(page)"> 尾页 </a></li>
                            <li :class="{'disabled': current == page}">
                                <a href="javascript:;" aria-label="Next" @click="setCurrent(current + 1)">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                        </ul>-->
                    </td>

                    <td colspan="3" class="text-center">
                        <div class="table-summary">
                            <div class="input-group">
                                <div class="input-group-addon">到第</div>
                                <input type="text" class="form-control" id="goto" value=""  style="width:40px;">
                                <div class="input-group-addon">页</div>
                                <span class="input-group-btn">
                                            <a class="btn btn-primary" data-currentPage="{$currentPage}" data-lastPage="{$lastPage}" id="gotoPage"><i class="fa fa-arrow-right"></i>确定</a>
                                        </span>
                            </div>
                        </div>
                    </td>
                    <td colspan="1" class="text-center">
                        共<span id="total-record"  class="text-success fa-2x"> {$count} </span>条记录
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
        <div class="col-xs-12" id="edit-content">
        </div>
    </div>
</section>

{/block}

{block name="viewRecord"}
<!--编辑工具-->
<div id="viewRecord" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">账户ID:<span id="recordId"></span></h4>
            </div>
            <div class="modal-body">
                <div class="col-xs-12">
                    <form class="form-horizontal" name="editForm">
                        <div class="form-group noedit">
                            <label for="accountname">账户名</label>
                            <input type="text" class="form-control" id="accountname" name="username" />
                        </div>
                        <div class="form-group noedit">
                            <label for="nickname">昵称</label>
                            <input type="text" class="form-control" id="nickname" name="nickname" />
                        </div>
                        <div class="form-group" id="noopen">
                            <label for="last_login_at">最近登录</label>
                            <input type="text" class="form-control" name="last_login_at" id="last_login_at" />
                        </div>
                        <div class="form-group noedit">
                            <label for="email">电子邮箱</label>
                            <input type="text" class="form-control" id="email" name="email" />
                        </div>
                        <div class="form-group noedit">
                            <label for="devicecount">设备数</label>
                            <input type="number" class="form-control" min="0" id="devicecount" name="device_count" />
                        </div>
                        <div class="form-group">
                            <label for="accountgroup">用户组</label>
                            <select class="form-control" name="user_group_id" id="accountgroup">
                                {volist name="uGroup" id="g" empty="$empty" }
                                <option value="{$g.id}">{$g.name}</option>
                                {/volist}
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="agent">代理商</label>
                            <select class="form-control" name="franchiser_id" id="agent">
                                {volist name="agent" id="f" empty="$empty" }
                                <option value="{$f.id}">{$f.name}</option>
                                {/volist}
                            </select>
                        </div>
                        <div class="form-group noedit">
                            <label for="integral">积分</label>
                            <input type="text" class="form-control" name="integral" id="integral"/>
                        </div>
                        <div class="form-group" id="nocreate">
                            <label for="created_at">注册时间</label>
                            <input type="text" class="form-control" name="created_at" id="created_at" />
                        </div>

                        <div class="form-group">
                            <label for="remark">备注</label>
                            <input type="text" class="form-control" name="remark" id="remark" />
                        </div>
                    </form>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="modal-footer">
                <a class="btn btn-warning" data-dismiss="modal"><i class="fa fa-times"></i>关闭</a>
            </div>
        </div>
    </div>
</div>
<!--编辑工具-->
{/block}

{/block}